#include<iostream>
#include<algorithm>
 
using namespace std;
const int N=1e5+3,null=1e9+7;   
int h[N];


int find(int x)
{
	int k=(x%N+N)%N;
	while(h[k]!=null&&h[k]!=x){
		if(k==N) k=0;
		k++;
	}
	return k;
}


int main()
{
	int n;
	scanf("%d",&n);
	fill(h,h+N,null);
	
	while(n--){
		int x;
		char op[2];
		scanf("%s%d",&op,&x);
		int k=find(x); 
		
		if(op[0]=='I') h[k]=x;
		else{
			if(h[k]==null) printf("No\n");
			else  printf("Yes\n");
		}
	}
	return 0;
}
